import { useCustomFetch } from "@/utils/network";
import {Metadata} from "next";
import { Suspense } from "react";
import Loading from "./loading";
export async function generateMetadata(
  { params }: { params: any },
): Promise<Metadata> {
  let source: any = {}
  const arr = params.args
  try {
    const res = await fetch(`http://i18nport.dongsongkeji.com.cn/product?Type=${params.args[1]}&Series=${params.args[2]}&Name=${params.args[3]}`)
    const { data } = await res.json()
    data && (source = data[0] ?? {})

  } catch (e) {
    console.log("e ", e)
  }
  const title = source.Name + " | " + source.Type + " | " + source.Series
  return {
    title,
    description: title.replaceAll("|", ",") + source.Desc
  }
}
 

export default function DashboardLayout({
  children,
}: {
  children: React.ReactNode
}) {
  // return <Suspense fallback={<Loading />}>{children}</Suspense>
  return <>{children}</>
}